#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Function:   使用tesseract识别图片文件中的字符
Author:     bear
Version:    2018-1-21 19:00
Contact:
"""

import pytesseract


def ocr_by_image(ocr_image):
    code = pytesseract.image_to_string(ocr_image, lang='chi_sim')
    print '识别字符为: ', code.encode('utf-8')
    return code
